-
Notifications
You must be signed in to change notification settings - Fork 22.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(css): add information on scope (at-rule) boundary behavior #37336
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Preview URLs Flaws (48)URL:
(comment last updated: 2024-12-28 19:33:13) |
@@ -23,6 +23,8 @@ The `@scope` at-rule contains one or more rulesets (termed **scoped style rules* | |||
} | |||
``` | |||
|
|||
The scope's upper bound is inclusive and its lower bound is exclusive. To change this behavior, you can combine either selector with a universal child selector. For example, `@scope (scope root) to (scope limit > *)` would make both bounds inclusive, `@scope (scope root > *) to (scope limit)` would make both bounds exclusive, while `@scope (scope root > *) to (scope limit > *)` would give an exclusive upper bound and an inclusive lower bound. | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is useful information
This would be better placed in the description. This is the syntax section. The child selector portion is useful, but not required syntax. Also, the upper and lower bound is not yet defined, so is hard to parse here, but may be much more understandable if it comes after "The .article-body
scope root selector defines the upper bound of the DOM tree scope in which the ruleset will be applied, and the figure scope limit selector defines the lower bound." (emphasis added)
Description
Add more details on @scope boundary behaviour.
Motivation
The default inclusivity / exclusivity behaviour is non-obvious. There is description of it in the MDN page, and no example showing how to invert the selectivity if needed. There is also nothing that explains that a scope limit can be used with an inline @scope.
Additional details
In this revision, the selectivity behaviour is described, and examples given of how to alter the behaviour if needed.
The universal child selector approach is recommended in this WG bug for the lower bound: w3c/csswg-drafts#6577 . It generalises to the upper bound.
Related issues and pull requests